As a semantic knowledge base, Knowledge Graph (KG) uses structured triples to store real-world entities and their internal relationships. In order to infer the missing real triples in the knowledge graph, considering the strong triple representation ability of relational memory network and the powerful feature processing ability of capsule network, a knowledge graph embedding model of capsule network based on relational memory was proposed. First, the encoding embedding vectors were formed through the potential dependencies between encoding entities and relationships and some important information. Then, the embedding vectors were convolved with the filter to generate different feature maps, and the corresponding capsules were recombined. Finally, the connections from the parent capsule to the child capsule was specified through the compression function and dynamic routing, and the confidence coefficient of the current triple was estimated by the inner product score between the child capsule and the weight. Link prediction experimental results show that compared with CapsE model, on the Mean Reciprocal Rank (MRR) and Hit@10 evaluation indicators, the proposed model has the increase of 7.95% and 2.2 percentage points respectively on WN18RR dataset, and on FB15K-237 dataset, the proposed model has the increase of 3.82% and 2 percentage points respectively. Experiments results show that the proposed model can more accurately infer the relationship between the head entity and the tail entity.